package com.xyhuo.leetcode.y2025;

import com.xyhuo.leetcode.common.ListNode;

public class DeleteNode {

    public void deleteNode(ListNode node) {
        ListNode last = node;
        ListNode current = node.next;
        while (true) {
            last.val = current.val;
            if (current.next == null) {
                last.next = null;
                break;
            }

            last = current;
            current = current.next;
        }
    }
}
